<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GMimeFilterBest: GMime 3.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="GMime 3.0 Reference Manual">
<link rel="up" href="Filters.html" title="Stream Filters">
<link rel="prev" href="GMimeFilterBasic.html" title="GMimeFilterBasic">
<link rel="next" href="GMimeFilterCharset.html" title="GMimeFilterCharset">
<meta name="generator" content="GTK-Doc V1.32 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GMimeFilterBest.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GMimeFilterBest.object-hierarchy" class="shortcut">Object Hierarchy</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="Filters.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GMimeFilterBasic.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GMimeFilterCharset.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GMimeFilterBest"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GMimeFilterBest.top_of_page"></a>GMimeFilterBest</span></h2>
<p>GMimeFilterBest — Determine the best charset/encoding to use for a stream</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GMimeFilterBest.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GMimeFilter.html" title="GMimeFilter"><span class="returnvalue">GMimeFilter</span></a> *
</td>
<td class="function_name">
<a class="link" href="GMimeFilterBest.html#g-mime-filter-best-new" title="g_mime_filter_best_new ()">g_mime_filter_best_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">const <span class="returnvalue">char</span> *
</td>
<td class="function_name">
<a class="link" href="GMimeFilterBest.html#g-mime-filter-best-charset" title="g_mime_filter_best_charset ()">g_mime_filter_best_charset</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a>
</td>
<td class="function_name">
<a class="link" href="GMimeFilterBest.html#g-mime-filter-best-encoding" title="g_mime_filter_best_encoding ()">g_mime_filter_best_encoding</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GMimeFilterBest.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GMimeFilterBest.html#GMimeFilterBest-struct" title="struct GMimeFilterBest">GMimeFilterBest</a></td>
</tr>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="GMimeFilterBest.html#GMimeFilterBestFlags" title="enum GMimeFilterBestFlags">GMimeFilterBestFlags</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GMimeFilterBest.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    GObject
    <span class="lineart">╰──</span> <a class="link" href="GMimeFilter.html" title="GMimeFilter">GMimeFilter</a>
        <span class="lineart">╰──</span> GMimeFilterBest
</pre>
</div>
<div class="refsect1">
<a name="GMimeFilterBest.description"></a><h2>Description</h2>
<p>A <a class="link" href="GMimeFilter.html" title="GMimeFilter"><span class="type">GMimeFilter</span></a> which is meant to determine the best charset and/or
transfer encoding suitable for the stream which is filtered through
it.</p>
</div>
<div class="refsect1">
<a name="GMimeFilterBest.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="g-mime-filter-best-new"></a><h3>g_mime_filter_best_new ()</h3>
<pre class="programlisting"><a class="link" href="GMimeFilter.html" title="GMimeFilter"><span class="returnvalue">GMimeFilter</span></a> *
g_mime_filter_best_new (<em class="parameter"><code><a class="link" href="GMimeFilterBest.html#GMimeFilterBestFlags" title="enum GMimeFilterBestFlags"><span class="type">GMimeFilterBestFlags</span></a> flags</code></em>);</pre>
<p>Creates a new GMimeFilterBest filter. <em class="parameter"><code>flags</code></em>
 are used to determine
which information to keep statistics of. If the
<a class="link" href="GMimeFilterBest.html#GMIME-FILTER-BEST-CHARSET:CAPS"><span class="type">GMIME_FILTER_BEST_CHARSET</span></a> bit is set, the filter will be able to
compute the best charset for encoding the stream of data
filtered. If the <a class="link" href="GMimeFilterBest.html#GMIME-FILTER-BEST-ENCODING:CAPS"><span class="type">GMIME_FILTER_BEST_ENCODING</span></a> bit is set, the filter
will be able to compute the best Content-Transfer-Encoding for use
with the stream being filtered.</p>
<p>Note: In order for the <a class="link" href="GMimeFilterBest.html#g-mime-filter-best-charset" title="g_mime_filter_best_charset ()"><code class="function">g_mime_filter_best_charset()</code></a> function to
work, the stream being filtered MUST already be encoded in UTF-8.</p>
<div class="refsect3">
<a name="g-mime-filter-best-new.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>flags</p></td>
<td class="parameter_description"><p>filter flags</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-filter-best-new.returns"></a><h4>Returns</h4>
<p> a new best filter with flags <em class="parameter"><code>flags</code></em>
.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-filter-best-charset"></a><h3>g_mime_filter_best_charset ()</h3>
<pre class="programlisting">const <span class="returnvalue">char</span> *
g_mime_filter_best_charset (<em class="parameter"><code><a class="link" href="GMimeFilterBest.html" title="GMimeFilterBest"><span class="type">GMimeFilterBest</span></a> *best</code></em>);</pre>
<p>Calculates the best charset for encoding the content filtered
through the <em class="parameter"><code>best</code></em>
 filter.</p>
<div class="refsect3">
<a name="g-mime-filter-best-charset.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>best</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeFilterBest.html" title="GMimeFilterBest"><span class="type">GMimeFilterBest</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-filter-best-charset.returns"></a><h4>Returns</h4>
<p> the name of the charset most suitable for encoding
the content that has been passed through the filter or <code class="literal">NULL</code>
if the filter was not configured to detect this.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="g-mime-filter-best-encoding"></a><h3>g_mime_filter_best_encoding ()</h3>
<pre class="programlisting"><a class="link" href="gmime-gmime-encodings.html#GMimeContentEncoding" title="enum GMimeContentEncoding"><span class="returnvalue">GMimeContentEncoding</span></a>
g_mime_filter_best_encoding (<em class="parameter"><code><a class="link" href="GMimeFilterBest.html" title="GMimeFilterBest"><span class="type">GMimeFilterBest</span></a> *best</code></em>,
                             <em class="parameter"><code><a class="link" href="gmime-gmime-encodings.html#GMimeEncodingConstraint" title="enum GMimeEncodingConstraint"><span class="type">GMimeEncodingConstraint</span></a> constraint</code></em>);</pre>
<p>Calculates the most efficient Content-Transfer-Encoding for the
content filtered through <em class="parameter"><code>best</code></em>
 that fits within the encoding
<em class="parameter"><code>constraint</code></em>
.</p>
<div class="refsect3">
<a name="g-mime-filter-best-encoding.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>best</p></td>
<td class="parameter_description"><p>a <a class="link" href="GMimeFilterBest.html" title="GMimeFilterBest"><span class="type">GMimeFilterBest</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>constraint</p></td>
<td class="parameter_description"><p>a <a class="link" href="gmime-gmime-encodings.html#GMimeEncodingConstraint" title="enum GMimeEncodingConstraint"><span class="type">GMimeEncodingConstraint</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="g-mime-filter-best-encoding.returns"></a><h4>Returns</h4>
<p> the best encoding for the content filtered by <em class="parameter"><code>best</code></em>
.</p>
</div>
</div>
</div>
<div class="refsect1">
<a name="GMimeFilterBest.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GMimeFilterBest-struct"></a><h3>struct GMimeFilterBest</h3>
<pre class="programlisting">struct GMimeFilterBest;</pre>
<p>A filter for calculating the best encoding and/or charset to encode
the data passed through it.</p>
<div class="refsect3">
<a name="GMimeFilterBest.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GMimeFilterBestFlags"></a><h3>enum GMimeFilterBestFlags</h3>
<p>Bit flags to enable charset and/or encoding scanning to make
educated guesses as to what the best charset and/or encodings to
use for the content passed through the filter.</p>
<div class="refsect3">
<a name="GMimeFilterBestFlags.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="GMIME-FILTER-BEST-CHARSET:CAPS"></a>GMIME_FILTER_BEST_CHARSET</p></td>
<td class="enum_member_description">
<p>Enable best-charset detection.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="GMIME-FILTER-BEST-ENCODING:CAPS"></a>GMIME_FILTER_BEST_ENCODING</p></td>
<td class="enum_member_description">
<p>Enable best-encoding detection.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GMimeFilterBest.see-also"></a><h2>See Also</h2>
<p><a class="link" href="GMimeFilter.html" title="GMimeFilter"><span class="type">GMimeFilter</span></a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.32</div>
</body>
</html>